#include "imx6ul.h"
void clk_enable(void)
{
    CCM->CCGR0 = 0xffffffff;
    CCM->CCGR1 = 0xffffffff;
    CCM->CCGR2 = 0xffffffff;
    CCM->CCGR3 = 0xffffffff;
    CCM->CCGR4 = 0xffffffff;
    CCM->CCGR5 = 0xffffffff;
    CCM->CCGR6 = 0xffffffff;
}
void led_init(void)
{
    IOMUX_SW_MUX->GPIO1_IO03 = 0x05;
    IOMUX_SW_PAD->GPIO1_IO03 = 0x10b0;

    GPIO1->GDIR |= 1 << 3;
    GPIO1->DR &= ~(1<<3);
}
void delay_short(volatile unsigned int num)
{
    while (num--)
    {
        /* code */
    }
}
void delay(volatile unsigned int num)
{
    while(num--)
    {
        delay_short(0x7ff);
    }
}
void led_on(void)
{
    GPIO1->DR &= ~(1<<3);
}
void led_off(void)
{
    GPIO1->DR |= 1<<3;
}
int main()
{
    clk_enable();
    led_init();
    while (1)
    {
        led_on();
        delay(50);
        led_off();
        delay(50);
    }
}